Efficient String Construction
Immutable strings cannot be modified in place.
Repeated concatenation may create many temporary objects.
The cumulative copying can become quadratic for a growing result.
StringBuilder maintains a mutable buffer and grows its capacity as needed.
With suitable capacity management, StringBuilder typically provides near-linear total construction time.